<?php
if (!defined('baseinfo')) {
    exitdata();
}


?>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script>
<script src="<?=baseinfo?>/js/vendor/gmap3.js"></script>

<script src="<?=baseinfo?>/js/vendor/jquery.iuploader-1.0.js"></script>
<script src="<?=baseinfo?>/js/vendor/jquery.Jcrop.min.js"></script>
<script src="<?=baseinfo?>/js/setting.js"></script>
<script src="<?=baseinfo?>/js/coreadd.js"></script>
<link rel="stylesheet" href="<?=baseinfo?>/css/vendor/jcrop/jquery.Jcrop.min.css" type="text/css" />
<link rel="stylesheet" href="<?=baseinfo?>/css/theme1/coreadd.css" type="text/css" />
<script>
var rowdiv=1;

$( document ).ready(function() {
  getserialnumber();

 
   imageset(1,800,250,800,250);
   
   imageset(2,350,350,175,175);
   
   setdatarowevent(1);
   
     <? if(NameDmconnex=="BCAZ"||NameDmconnex=="Infostant"||NameDmconnex=="Bangpan"){?>
  
  imageset(3,350,350,150,150);
  imageset(4,2048,640,745,233);
  imageset(5,2048,640,745,233);
  imageset(6,2048,640,745,233);
  imageset(7,2048,640,745,233);
  imageset(8,2048,640,745,233);
  
  getbanneruserdata();
  <?}?>
   
   setdatarow(<?=$data['userdata']['countryid']?>,<?=$data['userdata']['proid']?>,<?=$data['userdata']['disid']?>,<?=$data['userdata']['tumid']?>,'<?=$data['userdata']['statedata']?>',1);
   
   setdatarowevent(2);
   setdatarow(<?=$data['userdata']['shipcountryid']?>,<?=$data['userdata']['shipproid']?>,<?=$data['userdata']['shipdisid']?>,<?=$data['userdata']['shiptumid']?>,'<?=$data['userdata']['shipstate']?>',2);
   
   <?
   
   if($data['userdata']['sameaddress'])
   {
   ?>
   $("#sameaddress-1").trigger('click');
   <?
   }
   
   ?>
   
   
   
   setmap('<?=$data['userdata']['lat']?>','<?=$data['userdata']['lng']?>',1);

   $('#fullprofileform').submit(function() {
   loaddata();
  $.post(serviceinfo+'savesetting', $('#fullprofileform').serialize(), function(data) {  
   loadclosedata();   
    if(data.error.response)
    {
    alertbox(data.error.error);

    }else
    {
    boxmsgdata('Done');
    }  
  
  
  })
   return false;
   });
   
   
   $('#accountform').submit(function() {
   loaddata();
  $.post(serviceinfo+'savesetting', $('#accountform').serialize(), function(data) {  
   loadclosedata();   
    if(data.error.response)
    {
    alertbox(data.error.error);

    }else
    {
    boxmsgdata('Done');
    }  
  
  
  })
   return false;
   });
   
   $('#allsettingform').submit(function() {
   loaddata();
  $.post(serviceinfo+'savesetting', $('#allsettingform').serialize(), function(data) {  
   loadclosedata();   
    if(data.error.response)
    {
    alertbox(data.error.error);

    }else
    {
    boxmsgdata('Done');
    }  
  
  
  })
   return false;
   });
   
   $('#serialsettingform').submit(function() {
      
         loaddata();
  $.post(serviceinfo+'savesetting', $('#serialsettingform').serialize(), function(data) {  
   loadclosedata();   
    if(data.error.response)
    {
    alertbox(data.error.error);

    }else
    {
    boxmsgdata('Done');
    }  
  
  
  })
   return false;
      
      
      
      });
    
    
    
    
   $('#bcazform').submit(function() {
      var arraydata={};
      
      if($('#bcazform input[name="pname"]').val()=='')
      {
      alertwrongboxmsgonly('Please Add Publication Name');
      
      return false;
      
      }
      
      arraydata['pname']=$('#bcazform input[name="pname"]').val();
      
      
      if($('#bcazform input[name="pemail"]').val()=='')
      {
      alertwrongboxmsgonly('Please Add Email Contact');
      
      return false;
      
      }
      
      arraydata['pemail']=$('#bcazform input[name="pemail"]').val();
      
      
      if($('#bcazform .imagecheck1 input[name="imgmid[]"]').val()=='')
      {
      alertwrongboxmsgonly('Please Add Image');
      
      return false;
      
      }
      arraydata['imgmid']=$('#bcazform .imagecheck1 input[name="imgmid[]"]').val();
      arraydata['simgmid']=$('#bcazform .imagecheck1 input[name="simgmid[]"]').val();
      arraydata['pubid']=$('#bcazform input[name="pubid"]').val();
      
     arraydata['countdata']=new Array(); 
     var krow=0; 
       $.each($('#bcazform .wrpBnPblSt'), function(index ) {
       
       if(($(this).find('input[name="sort"]').val()!=''&&$(this).find('input[name="imgmid[]"]').val()!='')&&($(this).find('input[name="link"]').val()!=''||$(this).find('input[name="tag"]').val()!=''))
       {
       
       arraydata['countdata'][krow]={};
       arraydata['countdata'][krow]['imgmid']=$(this).find('input[name="imgmid[]"]').val();
       arraydata['countdata'][krow]['simgmid']=$(this).find('input[name="simgmid[]"]').val();
       arraydata['countdata'][krow]['status']=$(this).find('input[type="radio"]:checked').val();
       arraydata['countdata'][krow]['sort']=$(this).find('input[name="sort"]').val();
       arraydata['countdata'][krow]['link']=$(this).find('input[name="link"]').val();
       arraydata['countdata'][krow]['tag']=$(this).find('input[name="tag"]').val();
       arraydata['countdata'][krow]['ubanid']=$(this).find('input[name="ubanid"]').val();
       
       krow++;
       
       }
       
       
       });
      
       
      
      
     
         loaddata();
  $.post(serviceinfo+'savebanneruser', arraydata, function(data) {  
   loadclosedata();   
    if(data.error.response)
    {
    alertbox(data.error.error);

    }else
    {
    boxmsgdata('Done');
    getbanneruserdata();
    }  
  
  
  })
   return false;
      
      
      
      });
    
    <?if($_GET['pageselect']=='Account'){?>
    opensetting('wrpAcntSt');
    <?}?>
    <?if($_GET['pageselect']=='Privacy'){?>
    opensetting('wrpSysSt')
    <?}?>
    <?if($_GET['pageselect']=='Serial'){?>
    opensetting('wrpSerialSt')
    <?}?>
    
     <?if($_GET['pageselect']=='Publication'){?>
    opensetting('wrprPblSt')
    <?}?>
    
   });
  
  


</script>